<%--
  Created by IntelliJ IDEA.
  User: wty_5
  Date: 2018/8/14
  Time: 10:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>退出</title>
</head>
<body>
<%


    Cookie cookies[] = request.getCookies();
    for (Cookie cookie : cookies) {
        System.out.println(cookie.getName());
        if (cookie.getName().equals("auto_login")) {
            cookie.setMaxAge(0);
            cookie.setPath("/");
            response.addCookie(cookie);
            break;
        }
    }
    request.getSession().invalidate();
    response.sendRedirect("main.jsp");
%>
</body>
</html>
